package com.zb.designmode.decorate.example112;

/**
 * <p>文件描述：</p>
 * <p>版权所有： 版权所有(C)2016-2099</p>
 * <p>内容摘要： </p>
 * <p>其他说明： </p>
 * Date 2019-05-06</p>
 * Author Bing.Zhao1
 *
 * @version 1.0
 */
public class Test {
    public static void main(String[] args) throws Exception {
//        ILogger existobj = new FileLogger();
//        ILogger newobj = new XMLLogger(existobj);
//        String s[] = {"how", "are", "you"};
//        for (int i = 0; i < s.length; i++) {
//            newobj.log(s[i]);
//            Thread.sleep(1000L);
//        }

        ILogger existobj = new ConsoleLogger();
        ILogger newobj = new UpLogger(existobj);
        String s[] = {"how", "are", "you"};
        for (int i = 0; i < s.length; i++) {
            newobj.log(s[i]);
            Thread.sleep(1000L);
        }

        System.out.println("End");
    }
}
